<?php
declare (strict_types = 1);

namespace app\controller;

use app\service\PaperService;
use app\BaseController;
use app\service\AuthService;
use app\validate\AuthValidate;
use think\App;
use think\exception\ValidateException;

class PaperController extends BaseController
{
    private $service;

    public function __construct(App $app)
    {

        parent::__construct($app);
            $this->service = new PaperService();
    }
    public function  getTestPaper(){
        return $this->service->getPaper();
    }
    public function intoTestPaper(){
        $data = $this->request->param(['name','title']);
        $this->service->intoPaper($data);
        return $this->returnJson();
    }
    public function deleteTestPaper($id){
        $this->service->deletePaper($id);
        return $this->returnJson();
    }
    public function updateTestPaper(){
        $id = $this->request->put('id');
        $this->service->updatePaper($id);
        return $this->returnJson();
    }
}
